package com.ChainBizPro.system.mapper;

import com.ChainBizPro.system.model.domain.PurchaseOrders;
import com.ChainBizPro.system.model.dto.Order.OrdersQueryRequest;
import com.ChainBizPro.system.model.dto.Order.OrderPaymentQueryRequest;
import com.ChainBizPro.system.model.vo.PurchaseOrderVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liusijia
 * @description 针对表【purchase_orders(采购订单)】的数据库操作Mapper
 * @createDate 2024-11-16 16:34:17
 * @Entity generator.domain.PurchaseOrders
 */
public interface PurchaseOrdersMapper extends BaseMapper<PurchaseOrders> {

    List<PurchaseOrderVO> getQueryWrapperByAdmin(Page<PurchaseOrderVO> pageParam,
            OrdersQueryRequest ordersQueryRequest);

    List<PurchaseOrderVO> getQueryWrapperByUser(Page<PurchaseOrderVO> pageParam, OrdersQueryRequest orderQueryRequest,
            Long userId);

    /**
     * 根据支付状态查询订单
     */
    List<PurchaseOrderVO> getOrdersByPaymentStatus(
            Page<PurchaseOrderVO> page,
            @Param("paymentStatus") String paymentStatus,
            @Param("queryRequest") OrderPaymentQueryRequest queryRequest,
            @Param("userId") Long userId);
}
